/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package bllImplement;

import bllInterface.BLLFileServer;
import bllInterface.FileMessage;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
import java.util.HashMap;
import java.util.Map;

/**
 *
 * @author Mrkupi
 */
public class BLLFileServerImpl extends UnicastRemoteObject implements BLLFileServer{

    private Map<String, FileMessage> files = new HashMap<>();
    
    public BLLFileServerImpl() throws RemoteException
    {
        super();
    }
    
    @Override
    public void upFile(String fileName, FileMessage fm) throws RemoteException {
        if (!files.containsKey( fileName )){
            files.put(fileName, fm);
        }
    }

    @Override
    public FileMessage downFile(String fileName) throws RemoteException {
        return files.get( fileName );
    }
}
